package iscript.uiFramework.components.window
{
	import flash.display.BitmapData;
	import iscript.uiFramework.components.layout.LayoutMargin;
	import iscript.uiFramework.components.text.Label;
	import iscript.uiFramework.components.toolbar.Toolbar;
	import iscript.uiFramework.components.toolButton.CloseButton;
	import iscript.uiFramework.components.toolButton.MinButton;
	import iscript.uiFramework.components.UIComponent;
	import iscript.uiFramework.UIFramework;
	
	public class WindowHeader extends UIComponent
	{
		
		private var _headBar:Toolbar; 
		private var _label:Label;
		internal var closeButton:CloseButton = new CloseButton();
		
		public function WindowHeader()
		{
		
		}
		
		override protected function initialize():void
		{
			_headBar = new Toolbar(400, 24);
			_headBar.getBackground().begFill(null);
			_headBar.LeftHBox.getLayout().margin = new LayoutMargin(6, 2, 2, 2);
			_headBar.render(this);
			_label = new Label();
			_label.text = "Title";
			_label.size = 12;
			_label.color = 0x15428B;
			_label.bold = true;
			_headBar.addCmpLeft(_label);
			_headBar.addCmpRight(closeButton);
			super.initialize();
		}
		
		override public function set width(value:Number):void
		{
			super.width = value;
			_headBar.width = value;
		}
		
		public function get icon():BitmapData
		{
			return _label.icon;
		}
		
		public function set icon(value:BitmapData):void
		{
			_label.icon = value;
		}
		
		public function get text():String
		{
			return _label.text;
		}
		
		public function set text(value:String):void
		{
			_label.text = value;
		}
	
	}

}